package com.site.service;

import com.site.parser.Parser;
import com.site.parser.ParserFactory;
import com.site.parser.utils.ParserType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by shengquan.wu on 2018/3/30.
 */
@Service
public class ParserService {

    @Autowired
    private ParserFactory parserFactory;

    public void doParse(String parseStr, ParserType parseType){
        Parser parser=parserFactory.getParser(parseType);
        System.out.println("ParseService.doParse.."+parser);
        parser.parse(parseStr);
    }

}
